  {  Petrova Tatjana
     This program works with classes.
     2012 / 11 / 03  }
program Work;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  Rectangle=class
    public
      a,b:integer;
      constructor Create1(num,num1:integer);
      procedure Square;virtual;
      procedure Update; virtual;
    private
      S:integer;
  end;
  SmartRectangle=class(Rectangle)
    procedure Set;override;
  end;
constructor Reactangle.Create1(num,num1:integer);
begin
  a:=num;
  b:=num;
end;
procedure Square.Rectangle;
begin
  writeln(S);
end;
procedure Update.Rectangle;
begin
  S := a*b;
end;
procedure Set.SmartRectangle;
begin
  S := a*b;
end;
procedure Square.SmartRectangle;
begin
  writeln(S);
end;
var
  r :Rectangle;
begin
  r :=Rectangle.Create;
  r.a :=10;
  r.b := 15;
  r.update;
  r.Square;
  readln;

end.

